# Created by: Olivier Duchateau
# $FreeBSD$

PORTNAME=	gfeedline
PORTVERSION=	2.4.1
CATEGORIES=	net-im python
MASTER_SITES=	GOOGLE_CODE

MAINTAINER=	olivierd@FreeBSD.org
COMMENT=	Social networking client

LICENSE=	GPLv3
LICENSE_FILE=	${WRKSRC}/GPL

BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}distutils-extra>=2.38:${PORTSDIR}/devel/py-distutils-extra
LIB_DEPENDS=	libwebkitgtk-3.0.so:${PORTSDIR}/www/webkit-gtk3
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}twistedCore>=14.0.0:${PORTSDIR}/devel/py-twistedCore \
	${PYTHON_PKGNAMEPREFIX}twistedWeb>=14.0.0:${PORTSDIR}/www/py-twistedWeb \
	${PYTHON_PKGNAMEPREFIX}xdg>=0.25:${PORTSDIR}/devel/py-xdg \
	${PYTHON_PKGNAMEPREFIX}dateutil>=2.1:${PORTSDIR}/devel/py-dateutil \
	${PYTHON_PKGNAMEPREFIX}oauth>=1.0.1:${PORTSDIR}/net/py-oauth \
	${PYTHON_PKGNAMEPREFIX}openssl>=0.13:${PORTSDIR}/security/py-openssl \
	${PYTHON_PKGNAMEPREFIX}beautifulsoup32>=3.2.1:${PORTSDIR}/www/py-beautifulsoup32

PROJECTHOST=	${PORTNAME}
USES=	gettext shebangfix
USE_PYTHON=	2
USE_PYDISTUTILS=	yes
INSTALLS_EGGINFO=	yes
USE_GNOME=	gtk30 pygobject3
INSTALLS_ICONS=	yes

GLIB_SCHEMAS=	com.googlecode.gfeedline.gschema.xml

SHEBANG_FILES=	gfeedline lib/plugins/post.py \
	lib/plugins/twitter/dd.py
python_CMD=	${SETENV} python

DATA_DIR=	${PREFIX}/share/gfeedline/html

post-patch:
	${FIND} ${WRKSRC} -type f -name '*.py' \
		| ${XARGS} ${REINPLACE_CMD} 's|/usr/share|${LOCALBASE}/share|'

post-install:
# Change access permissions, otherwise we get 'IOError: Permission denied'
	${FIND} ${STAGEDIR}${DATA_DIR} -type f | \
		${XARGS} ${CHMOD} 0644

.include <bsd.port.mk>
